<?php
    $fs = new functions();
    $db = new Database();
    $auth = Auth::getAuth('current_user');
    $json_decode = Settings::noti_settings($auth['id'],'notifications');
    
    $json_notifications = $json_decode[0]['notifications'];
    $json_comment = $json_notifications['Comment'];
    $json_like = $json_notifications['Like'];
    $json_tagged = $json_notifications['Tagged'];
    $json_request = $json_notifications['Request'];
    $json_message = $json_notifications['Message'];
    $json_count_checked = $json_notifications['count_checked'];
    $json_summary_notification = $json_notifications['summary_notification'];
    
    if($json_count_checked[0]==9){
       $checked = "checked=checked";
    }else{
       $checked = "";
    }
    if($json_summary_notification[0]==1){
       $checked_summary_notification = "checked=checked";
    }else{
       $checked_summary_notification = "";
    }
?>
<div class="fl-privacy-setting-wrapper">   
    <div class="fl-option-toolbar">
        <div class="account-settings icon"></div>
        <div class="fl-toolbar-left-wrapper">
            <h1>Privacy Settings</h1>  
        </div>
        <div class="fl-toolbar-right-wrapper">
            <!-- <a class="pinit icon dataTip" fl-data-application-id="1" fl-data-type="widget" fl-data-object-id="report" data-placement="left" data-original-title="Pin this to Dashboard"></a>-->
        </div> 
        <div class="clearfix"></div>
    </div><!-- end of option toolbar -->
  <h3>Notifications</h3><br/>
  <span class="theme-font-color">How You Want To Get Email Notifications?</span><Br/><Br/>   
<div class="fl-table-wrapper">
    <TABLE BORDER="5" WIDTH="100%" CELLPADDING="4" CELLSPACING="0" border="2">
     <TR>
        <TD>
            <!-- <input type="checkbox" class="selectAll_noti" name="selectCheckBox_noti[]" <?php echo $checked; ?> style="margin-top: 12px;">Select All -->
            <input type="checkbox" class="css-checkbox selectAll_noti" id="selectCheckBox_noti[]" name="selectCheckBox_noti[]" <?php echo $checked; ?> /><label for="selectCheckBox_noti[]" class="css-label"></label><span style="position: relative; left: 4px; top: 1px;">Select All</span>
        </TD>
        
     </TR>   
     <TR>
        <TD class="thead" style="text-align:center;">Name</TD>
        <TD class="thead" style="text-align:center;">Allow Post</TD>
        <TD class="thead" style="text-align:center;">Allow Comment</TD>
        <TD class="thead" style="text-align:center;">Allow Tasks</TD>
        <TD class="thead" style="text-align:center;">New Message</TD>
        <TD class="thead" style="text-align:center;">Reply Message</TD>
     </TR>
     
     <TR ALIGN="CENTER">
        <TD><i class="fa fa-comment"></i> Comment</TD>
        <TD></TD>
        <TD><center>
        
        <input type="checkbox" <?php $a = $fs->get_checked($json_comment[0]); echo $a['checked']; ?> class="css-checkbox selectCheckBox_noti" data-noti-name="Comment" name="selectCheckBox_noti[]" data-name="comment" data-value="<?php echo $a['val']; ?>" data-id="Comment" id="Comment" style="margin-top:12px;">
        <label for="Comment" class="css-label"></label>
        </center></TD>
        <TD></TD>
        <TD></TD>
        <TD></TD>
     </TR>
     <TR ALIGN="CENTER">
        <TD><i class="fa fa-thumbs-up"></i> Like</TD>
        <TD><center>
        <input type="checkbox"  <?php $b = $fs->get_checked($json_like[0]); echo $b['checked']; ?> class="css-checkbox selectCheckBox_noti" data-noti-name="Like" name="selectCheckBox_noti[]" data-name="like" data-value="<?php echo $b['val']; ?>" data-id="Post" id="Like" style="margin-top: 5px;">
        <label for="Like" class="css-label"></label>  
        </center></TD>
        <TD><center>
        <input type="checkbox"  <?php $c = $fs->get_checked($json_like[1]); echo $c['checked']; ?> class="css-checkbox selectCheckBox_noti" data-noti-name="Like" name="selectCheckBox_noti[]" data-name="like" data-value="<?php echo $c['val']; ?>" data-id="Post" id="Like2" style="margin-top: 5px;">
        <label for="Like2" class="css-label"></label>  
        </center></TD>
        <TD></TD>
        <TD></TD>
        <TD></TD>
     </TR>
     <TR ALIGN="CENTER">
        <TD><i class="fa fa-tag"></i> Tagged</TD>
        <TD><center><input type="checkbox" <?php $d = $fs->get_checked($json_tagged[0]); echo $d['checked']; ?> data-noti-name="Tagged" name="selectCheckBox_noti[]" data-name="tagged" data-value="<?php echo $d['val']; ?>"  class="selectCheckBox_noti css-checkbox" data-id="Post" style="margin-top: 5px;" id="tagged"><label for="tagged" class="css-label"></label></center></TD>
        <TD><center><input type="checkbox" <?php $e = $fs->get_checked($json_tagged[1]); echo $e['checked']; ?> data-noti-name="Tagged" name="selectCheckBox_noti[]" data-name="tagged" data-value="<?php echo $e['val']; ?>"  class="selectCheckBox_noti css-checkbox" data-id="Comment" style="margin-top: 5px;" id="tagged2"><label for="tagged2" class="css-label"></label></center></TD>
        <TD><center><input type="checkbox" <?php $f = $fs->get_checked($json_tagged[2]); echo $f['checked']; ?> data-noti-name="Tagged" name="selectCheckBox_noti[]" data-name="tagged" data-value="<?php echo $f['val']; ?>"  class="selectCheckBox_noti css-checkbox" data-id="Request" style="margin-top: 5px;" id="tagged3"><label for="tagged3" class="css-label"></label></center></TD>
        <TD></TD>
        <TD></TD>
     </TR>
     <TR ALIGN="CENTER">
        <TD><i class="fa fa-envelope"></i> Message</TD>
        <TD></TD>
        <TD></TD>
        <TD></TD>
        <TD><center><input type="checkbox" <?php $g = $fs->get_checked($json_message[0]); echo $g['checked']; ?> data-noti-name="Message" name="selectCheckBox_noti[]" data-name="message" data-value="<?php echo $g['val']; ?>"  class="selectCheckBox_noti css-checkbox" data-id="New Message" style="margin-top: 5px;" id="message"><label for="message" class="css-label"></label></center></TD>
        <TD><center><input type="checkbox" <?php $h = $fs->get_checked($json_message[1]); echo $h['checked']; ?> data-noti-name="Message" name="selectCheckBox_noti[]" data-name="reply" data-value="<?php echo $h['val']; ?>"  class="selectCheckBox_noti css-checkbox" data-id="Reply Message" style="margin-top: 5px;" id="message2"><label for="message2" class="css-label"></label></center></TD>
     </TR>
     
     <tr>
        <td colspan="6">
            <div class="fl-toolbar-left-wrapper">
                <span class="theme-font-color">Allow summary notifications?</span><Br/><Br/>
                <input type="checkbox" <?php echo $checked_summary_notification; ?> class="select_summar_noti css-checkbox" name="select_summar_noti[]"  style="margin-top: 12px;" id="summaryNotification"><label for="summaryNotification" class="css-label"></label>Check this one
            </div>
            <div class="fl-toolbar-right-wrapper">
                <input type="submit" class="btn-blueBtn save_notifications"  value="Save">
            </div>   
        </td>

     </tr>
  </TABLE>
</div>